Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

Q is empty.


QTRS
  ↳ Overlay + Local Confluence

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

Q is empty.

The TRS is overlay and locally confluent. By [19] we can switch to innermost.

↳ QTRS
  ↳ Overlay + Local Confluence
QTRS
      ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))


Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, null), f), xs) → AP(f, ap(last, xs))
AP(ap(ap(if, null), f), xs) → AP(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
AP(ap(if2, f), xs) → AP(dropLast, xs)
AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(if2, f), xs) → AP(map, f)
AP(ap(ap(if, null), f), xs) → AP(if2, f)
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))
AP(ap(ap(if, null), f), xs) → AP(cons, ap(f, ap(last, xs)))
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
AP(ap(map, f), xs) → AP(ap(if, ap(isEmpty, xs)), f)
AP(ap(map, f), xs) → AP(if, ap(isEmpty, xs))
AP(ap(map, f), xs) → AP(isEmpty, xs)
AP(ap(ap(if, null), f), xs) → AP(last, xs)

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
QDP
          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, null), f), xs) → AP(f, ap(last, xs))
AP(ap(ap(if, null), f), xs) → AP(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
AP(ap(if2, f), xs) → AP(dropLast, xs)
AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(if2, f), xs) → AP(map, f)
AP(ap(ap(if, null), f), xs) → AP(if2, f)
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))
AP(ap(ap(if, null), f), xs) → AP(cons, ap(f, ap(last, xs)))
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
AP(ap(map, f), xs) → AP(ap(if, ap(isEmpty, xs)), f)
AP(ap(map, f), xs) → AP(if, ap(isEmpty, xs))
AP(ap(map, f), xs) → AP(isEmpty, xs)
AP(ap(ap(if, null), f), xs) → AP(last, xs)

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 3 SCCs with 10 less nodes.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
QDP
                ↳ UsableRulesProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ ATransformationProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))

R is empty.
The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
QDP
                        ↳ QReductionProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

dropLast1(cons(x, cons(y, ys))) → dropLast1(cons(y, ys))

R is empty.
The set Q consists of the following terms:

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
                      ↳ QDP
                        ↳ QReductionProof
QDP
                            ↳ QDPSizeChangeProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

dropLast1(cons(x, cons(y, ys))) → dropLast1(cons(y, ys))

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
QDP
                ↳ UsableRulesProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ ATransformationProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))

R is empty.
The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
QDP
                        ↳ QReductionProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

last1(cons(x, cons(y, ys))) → last1(cons(y, ys))

R is empty.
The set Q consists of the following terms:

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
                      ↳ QDP
                        ↳ QReductionProof
QDP
                            ↳ QDPSizeChangeProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

last1(cons(x, cons(y, ys))) → last1(cons(y, ys))

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
QDP
                ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, null), f), xs) → AP(f, ap(last, xs))
AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → null
ap(ap(ap(if, null), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(if2, f), xs))
ap(ap(if2, f), xs) → ap(ap(map, f), ap(dropLast, xs))
ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, null), f), xs) → AP(f, ap(last, xs))
AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)

The TRS R consists of the following rules:

ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


AP(ap(ap(if, null), f), xs) → AP(f, ap(last, xs))
The remaining pairs can at least be oriented weakly.

AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
Used ordering: Polynomial interpretation [25]:

POL(AP(x1, x2)) = x1   
POL(ap(x1, x2)) = 1 + x2   
POL(cons) = 0   
POL(dropLast) = 0   
POL(if) = 0   
POL(if2) = 0   
POL(isEmpty) = 0   
POL(last) = 0   
POL(map) = 0   
POL(null) = 0   
POL(true) = 0   

The following usable rules [17] were oriented: none



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))

The TRS R consists of the following rules:

ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(last, ap(ap(cons, x), null)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
QDP
                            ↳ ATransformationProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, null), f), xs) → AP(ap(if2, f), xs)
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(if2, f), xs) → AP(ap(map, f), ap(dropLast, xs))

The TRS R consists of the following rules:

ap(isEmpty, null) → true
ap(isEmpty, ap(ap(cons, x), xs)) → null
ap(dropLast, ap(ap(cons, x), null)) → null
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, null), x0), x1)
ap(ap(if2, x0), x1)
ap(isEmpty, null)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), null))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, ap(ap(cons, x0), null))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
QDP
                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))
map1(f, xs) → if1(isEmpty(xs), f, xs)

The TRS R consists of the following rules:

isEmpty(null) → true
isEmpty(cons(x, xs)) → null
dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
isEmpty(null)
isEmpty(cons(x0, x1))
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

map(x0, x1)
if(true, x0, x1)
if(null, x0, x1)
if2(x0, x1)
last(cons(x0, null))
last(cons(x0, cons(x1, x2)))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))
map1(f, xs) → if1(isEmpty(xs), f, xs)

The TRS R consists of the following rules:

isEmpty(null) → true
isEmpty(cons(x, xs)) → null
dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

isEmpty(null)
isEmpty(cons(x0, x1))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule map1(f, xs) → if1(isEmpty(xs), f, xs) at position [0] we obtained the following new rules:

map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))
map1(y0, null) → if1(true, y0, null)



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
QDP
                                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))
map1(y0, null) → if1(true, y0, null)
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))

The TRS R consists of the following rules:

isEmpty(null) → true
isEmpty(cons(x, xs)) → null
dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

isEmpty(null)
isEmpty(cons(x0, x1))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
QDP
                                            ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))

The TRS R consists of the following rules:

isEmpty(null) → true
isEmpty(cons(x, xs)) → null
dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

isEmpty(null)
isEmpty(cons(x0, x1))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ UsableRulesProof
QDP
                                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))

The TRS R consists of the following rules:

dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

isEmpty(null)
isEmpty(cons(x0, x1))
dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

isEmpty(null)
isEmpty(cons(x0, x1))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ UsableRulesProof
                                              ↳ QDP
                                                ↳ QReductionProof
QDP
                                                    ↳ RuleRemovalProof

Q DP problem:
The TRS P consists of the following rules:

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))

The TRS R consists of the following rules:

dropLast(cons(x, null)) → null
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

dropLast(cons(x, null)) → null

Used ordering: POLO with Polynomial interpretation [25]:

POL(cons(x1, x2)) = 2 + x1 + x2   
POL(dropLast(x1)) = x1   
POL(if1(x1, x2, x3)) = 2·x1 + x2 + 2·x3   
POL(if21(x1, x2)) = x1 + 2·x2   
POL(map1(x1, x2)) = x1 + 2·x2   
POL(null) = 0   



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ UsableRulesProof
                                              ↳ QDP
                                                ↳ QReductionProof
                                                  ↳ QDP
                                                    ↳ RuleRemovalProof
QDP
                                                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))

The TRS R consists of the following rules:

dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


map1(y0, cons(x0, x1)) → if1(null, y0, cons(x0, x1))
The remaining pairs can at least be oriented weakly.

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))
Used ordering: Matrix interpretation [3]:
Non-tuple symbols:
M( cons(x1, x2) ) =
/1\
\0/
+
/00\
\00/
·x1+
/10\
\10/
·x2

M( null ) =
/0\
\1/

M( dropLast(x1) ) =
/0\
\0/
+
/01\
\01/
·x1

Tuple symbols:
M( map1(x1, x2) ) = 1+
[0,0]
·x1+
[1,0]
·x2

M( if1(x1, ..., x3) ) = 0+
[0,1]
·x1+
[0,0]
·x2+
[0,1]
·x3

M( if21(x1, x2) ) = 1+
[0,0]
·x1+
[0,1]
·x2


Matrix type:
We used a basic matrix type which is not further parametrizeable.


As matrix orders are CE-compatible, we used usable rules w.r.t. argument filtering in the order.
The following usable rules [17] were oriented:

dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ UsableRulesProof
                                              ↳ QDP
                                                ↳ QReductionProof
                                                  ↳ QDP
                                                    ↳ RuleRemovalProof
                                                      ↳ QDP
                                                        ↳ QDPOrderProof
QDP
                                                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

if1(null, f, xs) → if21(f, xs)
if21(f, xs) → map1(f, dropLast(xs))

The TRS R consists of the following rules:

dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

dropLast(cons(x0, null))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 2 less nodes.